package com.lvmama.pangolin.service.impl;


import java.util.List;


import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lvmama.pangolin.entity.Timer;
import com.lvmama.pangolin.mybatis.mapper.TimerMapper;
import com.lvmama.pangolin.service.TimerService;
@Transactional
@Service
public class TimerServiceImpl implements TimerService{
	
	@Autowired
	private TimerMapper timerMapper;
	public int insertTimerList(List<Timer> list) 
	{
		return timerMapper.insertTimerList(list);
	}
	
	public List<Timer> queryTimerList(Timer timer)
	{
		return timerMapper.queryTimerList(timer);
	}

	@Override
	public List<Timer> queryTimerListByCon(Map<String, Object> param)
	{
		return timerMapper.queryTimerListByCon(param);
	}

	@Override
	public List<Timer> queryTimerGroupByTaskId(Map<String, Object> param)
	{
		return timerMapper.queryTimerGroupByTaskId(param);
	}

	@Override
	public int updateTimerByCon(Map<String, Object> param)throws Exception
	{
		return timerMapper.updateTimerByCon(param);
	}

	@Override
	public List<Timer> getTimerList(Map<String,Object> map) throws Exception{
		
		return timerMapper.getTimerList(map);
	}

	@Override
	public int updateRunNumByCon(String timerId)
	{
		return timerMapper.updateRunNumByCon(timerId);
	}

	@Override
	public int deleteByPrimaryKey(String timerId)
	{
		return timerMapper.deleteByPrimaryKey(timerId);
	}

	@Override
	public int deleteTimerList(List<Timer> list)
	{
		return timerMapper.deleteTimerList(list);
	}

	@Override
	public int insertTimerListToH(List<Timer> list)
	{
		return timerMapper.insertTimerListToH(list);
	}

	@Override
	public void moveTimerToHistory(List<Timer> list)
	{
		timerMapper.deleteTimerListH(list);
		timerMapper.insertTimerListToH(list);
		timerMapper.deleteTimerList(list);
	}
	
	@Override
	public List<Timer> queryTimerHListByCon(Map<String,Object> param)
	{
		return timerMapper.queryTimerHListByCon(param);
	}

	@Override
	public int deleteByPrimaryKeyH(String timerId)
	{
		return timerMapper.deleteByPrimaryKeyH(timerId);
	}

	@Override
	public int deleteTimerListH(List<Timer> list)
	{
		return timerMapper.deleteTimerListH(list);
	}
	
	

}
